<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<div id = "menuImpiegato">
		<ui:include src="/pagine_impiegati/commonHeader.xhtml" />
	</div>
</h:head>


<h:body>
	<h:form>
		<p:panel header="Modifica Pacchetto">
			<h:panelGrid columns="2" id="modGrid">
			
				<h:outputText value="Nome Pacchetto:" />
				<p:inputText value = "#{prenotazBean.selectedPack.nome}"/>
				
				<h:outputText value="Luogo:" />
				<p:inputText value = "#{prenotazBean.selectedPack.luogo}"/>
				
				<h:outputText value="Posti disponibili:"/>
				<p:inputText value = "#{prenotazBean.selectedPack.numeroPosti}"/>
				
				<h:outputText value="Data Partenza:"/>
				<p:calendar value = "#{prenotazBean.selectedPack.dataPartenza}"/>
				
				<h:outputText value="Data Ritorno:"/>
				<p:calendar value = "#{prenotazBean.selectedPack.dataArrivo}"/>
				
				
				
							
				<h:outputText value="Volo Andata" />
				<p:selectOneMenu id="voloAndata"
					value="#{prenotazBean.selectedPack.voloAndata}">
					<f:selectItem itemLabel="Select Volo" itemValue="#{prenotazBean.selectedPack.voloAndata}" />
					<f:selectItems value="#{prenotazBean.voliAndDisponili()}"
						var="volo"
						itemLabel="#{aerBean.getAeroportiNome(volo.aeroportoPartenza).get(0).nome} #{volo.compagnia} 
									#{volo.numVolo}"
						itemValue="#{volo.idVolo}" />
				</p:selectOneMenu>

				<h:outputText value="Volo Ritorno" />
				<p:selectOneMenu id="voloRitorno"
					value="#{prenotazBean.selectedPack.voloAndata}">
					<f:selectItem itemLabel="Select Volo" itemValue="#{prenotazBean.selectedPack.voloRitorno}" />
					<f:selectItems value="#{prenotazBean.voliRitDisponibili()}"
						var="volo"
						itemLabel="#{aerBean.getAeroportiNome(volo.aeroportoArrivo).get(0).nome} #{volo.compagnia} 
									#{volo.numVolo}"
						itemValue="#{volo.idVolo}" />
				</p:selectOneMenu>

				<h:outputText value="Hotel" />
				<p:selectOneMenu id="hotel"
					value="#{prenotazBean.selectedPack.hotel}">
					<f:selectItem itemLabel="Seleziona se si vuole modificare" itemValue="#{prenotazBean.selectedPack.hotel}" />
					<f:selectItems value="#{prenotazBean.hotelDisponibili()}"
						var="hotel" itemLabel="#{hotel.nome} #{hotel.prezzoSingolo}"
						itemValue="#{hotel.idHotel}" />
				</p:selectOneMenu>
				
				<h:outputText value="Escursione" />
				<p:selectOneMenu id="escursione"
					value="#{prenotazBean.selectedPack.escursione}">
					<f:selectItem itemLabel="Select City" itemValue="#{prenotazBean.selectedPack.escursione}" />
					<f:selectItems value="#{prenotazBean.escursioniDisponibili()}"
						var="escursione" itemLabel="#{escursione.nome} #{escursione.prezzoSingolo}"
						itemValue="#{escursione.idEscursione}" />
				</p:selectOneMenu>

				<h:outputText value="Prezzo del pacchetto " />
				<p:inputText value="#{prenotazBean.selectedPack.prezzo}"/>
				

			</h:panelGrid>
			<p:commandButton value="Salva"
				action="#{prenotazBean.save()}" update="growl" />
			<p:growl id="growl" sticky="true" showDetail="true" />

		</p:panel>
	</h:form>

</h:body>
</html>